import org.junit.Test;
import wx.PayUtils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.UUID;

public class SHYQ {
    public static final String REQUEST_URL = "http://119.28.34.43/api/remit/order";

    public static final String QUERY_URL = "";

    public static final String MERCHANT_NO = "90000022";

    public static final String KEY = "aqww960nwg6gcs7h9m0woz65hrgzj5ph64knk3mitxp0q3bd6vn0u5afetnnxkjyo0ziwkcz";

    @Test
    public void daifu(){
        HashMap<String, String> params = new HashMap<>();
        params.put("version", "1.1");
        params.put("merchantId", MERCHANT_NO);
        params.put("traceNO", String.valueOf(new Date().getTime()));
        params.put("requestTime",new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
        params.put("remitAmt","3");
        params.put("remitPayeeType","1");
        params.put("payeeName","屈子威");
        params.put("payeeBankAccount","622908333045944898");
        params.put("payeeBankName","兴业银行");
        params.put("nonceStr",UUID.randomUUID().toString().replaceAll("-",""));
        params.put("notifyUrl","http://baidu.com");
        params.put("signType","SHA256");
        String sign = PayUtils.sign(params, KEY);
        params.put("sign",sign);
        System.out.println("发送请求》》》》》》》》》》》》》》》》》》》》");
        String response = PayUtils.makeRequest(params, REQUEST_URL);
        System.out.println(response);
    }
}
